package md.frolov.bible.commands;

import md.frolov.bible.views.SearchView;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PlatformUI;

public class FocusSearchView extends AbstractHandler implements IHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		IViewPart vp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SearchView.ID);
		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(vp);
		return null;
	}

}
